<?php
/*if(stristr($_SERVER['REQUEST_URI'], 'config.php')) die('system halted');
session_start();
define("DB_HOST",'localhost');
define("DB_USER",'u118261');
define('DB_PWD','TZvO3hzg');
define('DB_NAME','u118261_ceshi');
define('DB_PORT','3306');
define('DB_TYPE','mysql');
define('DB_CHARSET','utf8');
define("MEMCACHE_HOST","127.0.0.1");
define("MEMCACHE_PORT","11211");*/
if(stristr($_SERVER['REQUEST_URI'], 'init.php')) die('system halted');
header('content-type:text/html;charset=utf-8');
session_start();
$dbms = 'mysql';     //数据库类型
//$host = 'localhost'; //数据库主机名
$host = "localhost";
$dbName = 'u118261_ceshi';    //使用的数据库
//$user = 'root';      //数据库连接用户名
$user = 'u118261';
$pass = 'TZvO3hzg';          //对应的密码
$dbport = '3306';
define("MEMCACHE_HOST","127.0.0.1");
define("MEMCACHE_PORT","11211");
define("ACTIVE_COMPANY","升倍");
define("VOTE_NUM","3");
$dsn="$dbms:host=$host;port=$dbport;dbname=$dbName";
try{
    $dbh = new PDO($dsn, $user, $pass,array(PDO::MYSQL_ATTR_INIT_COMMAND  => "SET NAMES'utf8';"));//连接数据库
    $GLOBALS['PDO'] = $dbh;
    $dbh->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
}catch(PDOException $e) {
    echo "数据库连接失败".$e->getMessage();
    exit;
}
?>